<template>
  <div class="pay-info">
    <div>
      <p>商品件数:</p>
      <p>{{ length }}件</p>
    </div>
    <div>
      <p>商品总价:</p>
      <p>￥{{ totalPrice }}</p>
    </div>
    <div>
      <p>运<i/><i/>费:</p>
      <p>￥{{ 0 }}</p>
    </div>
    <div>
      <p>应付总额:</p>
      <p class="price">￥{{ totalPrice }}</p>
    </div>
  </div>
</template>

<script lang="ts"
        setup>
import {useCartStore} from '@/stores/cart'
import {storeToRefs} from 'pinia'

let cartStore = useCartStore()
let {length, totalPrice} = storeToRefs(cartStore)
</script>

<style lang="less"
       scoped>
.pay-info {
  width: 240px;

  > div {
    display: flex;

    p {
      height: 50px;

      &.price {
        color: @priceColor;
        font-size: 16px;
        font-weight: 900;
      }

      &:nth-of-type(1) {
        width: 70px;
        text-align: justify;

        i {
          display: inline-block;
          width: 1em;
        }
      }

      &:nth-of-type(2) {
        flex: 1;
        text-align: right;
      }
    }
  }
}
</style>